package ch.rheintalconnection.sysventory.presentation;

import org.apache.log4j.Logger;

import ch.rheintalconnection.sysventory.businessServices.NetworkScanner;
import ch.rheintalconnection.sysventory.businessServices.ScanningService;
import ch.rheintalconnection.sysventory.technicalServices.IDataReader;
import ch.rheintalconnection.sysventory.technicalServices.IDataWriter;
import ch.rheintalconnection.sysventory.technicalServices.IIpScanner;
import ch.rheintalconnection.sysventory.technicalServices.IpScannerMock;
import ch.rheintalconnection.sysventory.technicalServices.hibernate.MySqlDataReader;
import ch.rheintalconnection.sysventory.technicalServices.hibernate.MySqlDataWriter;

/**
 * @author Jonas Benz
 */
public class Bootstrapper {
	
	private Logger logger;
	private ScanningService scanningService;
	private IDataReader dataReader;
	
	public Bootstrapper() {
		
		logger = Logger.getRootLogger();
		
		IIpScanner ipScanner = new IpScannerMock();
		NetworkScanner networkScanner = new NetworkScanner(ipScanner);
		IDataWriter dataWriter = new MySqlDataWriter();
		dataReader = new MySqlDataReader(logger);
		
		scanningService = new ScanningService(networkScanner, dataWriter);
	}

	public ScanningService getScanningService() {
		return scanningService;
	}
	
	public IDataReader getDataReader() {
		return dataReader;
	}

}
